<?php

return array(
    //шаблон
     'view_script' => false,

    'jqgrid_category_edit_url' => array(
        'action' => 'ajax-category-operations'
    ),
    'jqgrid_category_model_url' => array(
        'action' => 'list-category-model'
    ),
    'jqgrid_back_url' => array(
        'action' => 'list-category'
    ),

	'backurl_label' => 'К списку категорий',

    'jqgrid_category_navgrid' => array(
        'edit' => true,
		'search' => true
    ),
    'jqgrid_category_navgrid_buttons' => array(
        array(
            'buttonicon' => 'ui-icon-folder-open',
            'caption' => 'Разделы',
            'position' => 'last',
            'onClickHandlerParams' => array(
                'url' => '/materials/admin/list-category'
            ),
			'id' => 'bt_list_categories'
        ),
        array(
            'buttonicon' => 'ui-icon-document',
            'caption' => 'Материалы',
            'position' => 'last',
            'onClickHandlerParams' => array(
                'url' => '/materials/admin/list-material'
            ),
			'id' => 'bt_list_materials'
        ),
        array(
            'buttonicon' => 'ui-icon-plusthick',
            //'caption' => 'Создать материал',
            'caption' => '',
            'title' => 'Создать материал',
            'position' => 'last',
            'onClickHandlerParams' => array(
                'url' => '/materials/admin/add-material'
            ),
			'id' => 'bt_add_material'
        ),
        array(
            'buttonicon' => 'ui-icon-circle-plus',
            //'caption' => 'Добавить материалы',
            'caption' => '',
            'title' => 'Добавить материалы в категорию',
            'position' => 'last',
            'onClickHandlerParams' => array(
                'url' => '/materials/admin/select-category-materials'
            ),
			'id' => 'bt_select_materials'
        ),
        array(
            'buttonicon' => 'ui-icon-circle-minus',
            //'caption' => 'Удалить материалы',
            'caption' => '',
            'title' => 'Удалить материалы из категории',
            'position' => 'last',
            'onClickHandlerParams' => array(
                'url' => '/materials/admin/unselect-category-materials'
            ),
			'id' => 'bt_unselect_materials'
        ),
    ),

    'jqgrid_category_caption' => 'Список',

    'jqgrid_category_col_names' => array(
        'Название', 'Код', 'Дата публикации', 'Активность','ID'
    ),

    'jqgrid_category_col_model' => array(
        0 => array(
            'name' => 'name',
            'index' => 'name',
            'width' => 200,
            'editable' => true,
            'search' => true,
            'editrules' => array(
                'required' => true
            )
        ),
        1 => array(
            'name' => 'code',
            'index' => 'code',
            'width' => 120,
            'editable' => true,
            'search' => true,
            'editrules' => array(
                'required' => true
            )
        ),
        2 => array(
            'name' => 'pub_date',
            'index' => 'pub_date',
            'width' => 160,
            'editable' => true,
            'search' => true,
            'editrules' => array(
                'required' => false
            ),
            'formatter' => 'date',
            'formatoptions' => array(
                'srcformat' => 'Y-m-d',
                'newformat' => 'd.m.Y'
            )
        ),
        3 => array(
            'name' => 'status', 'index' => 'status', 'width' => 55, 'sortable' => false,
            'editable' => true,
            'search' => true,
            'stype' => 'select',
            'searchoptions' => array(
                'value' => array(
                    1 => 'Активный',
                    0 => 'Скрытый'
                )
            ),
            'edittype' => 'checkbox',
            'formatter' => 'checkbox',
            'editoptions' => array('value' => '1:0'),
            'formatoptions' => array('disabled' => true)
        ),
        5 => array(
            'name' => 'id',
            'index' => 'id',
            'width' => 55,
            'editable' => false,
            'search' => true,
        ),
    )
);

